package com.yztstudy.Utils;

import com.yztstudy.Entity.Cart;

import java.util.List;

/**
 * 计算购物车的工具类
 */

public class CartsTotalPriceUtils {

    public static double getTotalPrice(List<Cart> carts)
    {
        double sum = 0.0;
        for (Cart cart : carts)
        {
            sum += cart.getTotal();
        }
        return sum;
    }
}
